import {ref, reactive, onMounted, onUnmounted} from "vue";

import { getEduVideoDictList } from '@/api';

/* eslint-disable-next-line */
const color = ['rgb(116,166,49)', 'rgb(190,245,99)', 'rgb(202,252,137)', 'rgb(251,253,142)']

export default function() {
    const dict = reactive({
        areaList: [],
        eduLvList: [],
        orgNatureList: [],
    })

    const update = () => {
        getEduVideoDictList().then(res => {
            if (res.code == '200') {
                dict.areaList = res.result.areaList
                dict.eduLvList = res.result.eduLvList
                dict.orgNatureList = res.result.orgNatureList
            }
        })
    }

    onMounted(() => {
        update()
        // task = setInterval(() => {
        //     update()
        // }, 1000 * 60 * 60)
    })
    onUnmounted(() => {
        // task && clearInterval(task)
    })

    return {
        dict,
    }
}
